---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.11.log
  log type:  text
 opened on:  12 May 2025, 16:59:25

. use "C:\Users\sbstjp\OneDrive - Cardiff University\PVScleandata.dta" // Prosser, Magasin, Proulx and Haddock,
>  UK Progressive Values Dataset, April 2024 // Accessed on March 16 2025

. 
. // Create a weight
. gen weight = 1

. 
. * Code variables into categories
. recode age (min/24=1 "0-24") (25/34=2 "25-34") (35/44=3 "35-44") (45/54=4 "45-54") (55/max=5 "55+"), generate
> (age_group)
(672 differences between age and age_group)

. recode ethnicity (1=1) (2=2) (3=3) (5=4) (6=4) (7=4) (4=5) (8=6), generate(ethnic_group)
(243 differences between ethnicity and ethnic_group)

. label define ethnic_group_lbl 1 "White" 2 "Black" 3 "Hispanic" 4 "Asian or Native Hawaiian/other Pacific Isla
> nder, non-Hispanic" 5 "Native American/Alaska Native or other race, non-Hispanic" 6 "Multiple races, non-Hisp
> anic"

. label values ethnic_group ethnic_group_lbl

. recode education (3=1) (4=1) (5=1) (6=2) (7=2) (8=3) (9=4) (10=4) (11=4), generate(ed_group)
(672 differences between education and ed_group)

. recode householdincome (1=1) (2=1) (3=1) (4=1) (5=1) (6=1) (7=1) (8=2) (9=2) (10=2) (11=2) (12=3) (13=4), gen
> erate(inc_group)
(621 differences between householdincome and inc_group)

. 
. * Generate totals for the weights - these are based on the ANES24 pre-election wave as this dataset has polit
> ical selfid, unlike census data. The below are for 1-4, i.e. very liberal to centrist, on the political selfi
> d scale. This mirrors the PVS sample. 
. 
. replace gender=. if inrange(gender, 3, 5)
(34 real changes made, 34 to missing)

. rename gender FemaleGender

. gen sextot=.
(672 missing values generated)

. replace sextot = 0.4663 if FemaleGender == 1 // Male
(211 real changes made)

. replace sextot = 0.5337 if FemaleGender == 2 // Female
(427 real changes made)

. 
. gen agetot=.
(672 missing values generated)

. replace agetot = 0.1227 if age_group == 1 //18-24
(110 real changes made)

. replace agetot = 0.1848 if age_group == 2 //25-34
(218 real changes made)

. replace agetot = 0.1891 if age_group == 3 //35-44
(160 real changes made)

. replace agetot = 0.1544 if age_group == 4 //45-54
(111 real changes made)

. replace agetot = 0.3491 if age_group == 5 //55+
(73 real changes made)

. 
. gen ethtot=. 
(672 missing values generated)

. replace ethtot = 0.6038 if ethnic_group == 1 // White
(154 real changes made)

. replace ethtot = 0.1186 if ethnic_group == 2 // Black
(153 real changes made)

. replace ethtot = 0.1592 if ethnic_group == 3 // Hispanic
(121 real changes made)

. replace ethtot = 0.0659 if ethnic_group == 4 // Asian or Native Hawaiian
(150 real changes made)

. replace ethtot = 0.0024 if ethnic_group == 5 // Native American
(19 real changes made)

. replace ethtot = 0.0502 if ethnic_group == 6 // Multiple
(74 real changes made)

. 
. gen edtot=.
(672 missing values generated)

. replace edtot = 0.4408 if ed_group == 1 // Uptosomecollege
(219 real changes made)

. replace edtot = 0.0926 if ed_group == 2 // Trade/assocdegree
(90 real changes made)

. replace edtot = 0.2754 if ed_group == 3 // Undergraddegree
(253 real changes made)

. replace edtot = 0.1912 if ed_group == 4 // Postgradandabove
(110 real changes made)

. 
. gen inctot=.
(672 missing values generated)

. replace inctot = 0.2528 if inc_group == 1 //under 60k
(352 real changes made)

. replace inctot = 0.2084 if inc_group  == 2 //60-100k
(190 real changes made)

. replace inctot = 0.1966 if inc_group  == 3 //100-150k
(76 real changes made)

. replace inctot = 0.3422 if inc_group  == 4 //over 150k
(54 real changes made)

. 
. * Rake the weights using the Stata survwgt package
. survwgt rake weight , by(FemaleGender age_group ethnic_group ed_group inc_group) totvars(sextot agetot ethtot
>  edtot inctot) generate(rakedweight)

. 
. // Demographics
. *Generate dummies
. gen Childless=.
(672 missing values generated)

. replace Childless=1 if numberofchildren==0
(434 real changes made)

. replace Childless=0 if inrange(numberofchildren, 1, 10)
(237 real changes made)

. 
. gen Graduate=. 
(672 missing values generated)

. replace Graduate=0 if inrange(education, 3, 7)
(309 real changes made)

. replace Graduate=1 if inrange(education, 8, 11)
(363 real changes made)

. 
. gen BIPOC=. 
(672 missing values generated)

. replace BIPOC=1 if inrange(ethnicity, 2, 8)
(517 real changes made)

. replace BIPOC=0 if ethnicity==1
(154 real changes made)

. 
. gen SocCulEmployment=. 
(672 missing values generated)

. replace occupationsector=. if occupationsector==24
(132 real changes made, 132 to missing)

. replace SocCulEmployment=0 if inrange(occupationsector, 11, 22)
(204 real changes made)

. replace SocCulEmployment=1 if inrange(occupationsector, 5, 10)
(196 real changes made)

. replace SocCulEmployment=0 if inrange(occupationsector, 1, 4)
(139 real changes made)

. 
. * Interaction terms
. gen FemGenChildlessInteraction = FemaleGender * Childless 
(35 missing values generated)

. gen AgeFemGenInteraction = FemaleGender * age 
(34 missing values generated)

. 
. // Standardize and rename
. egen Age = std(age)

. egen Income = std(householdincome)

. 
. * Change to 1-2 scale, so it's the same as other dependent variables in the book
. foreach var in pvs {
  2.     gen s`var' = 1 + (`var' - 1) / (7 - 1)
  3. }

. 
. rename spvs PVS

. 
. // Regressions
. regress PVS Age BIPOC FemaleGender Graduate Income SocCulEmployment [pweight= rakedweight], robust
(sum of wgt is .8429651150548035)

Linear regression                               Number of obs     =        511
                                                F(6, 504)         =       2.18
                                                Prob > F          =     0.0435
                                                R-squared         =     0.0971
                                                Root MSE          =     .12914

----------------------------------------------------------------------------------
                 |               Robust
             PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
             Age |  -.0200232   .0102531    -1.95   0.051    -.0401674     .000121
           BIPOC |   .0201679   .0221702     0.91   0.363    -.0233894    .0637253
    FemaleGender |   .0585632   .0237779     2.46   0.014     .0118473    .1052791
        Graduate |  -.0003546   .0240749    -0.01   0.988    -.0476541    .0469449
          Income |  -.0138504   .0108997    -1.27   0.204    -.0352648     .007564
SocCulEmployment |  -.0064188   .0243067    -0.26   0.792    -.0541738    .0413362
           _cons |    1.44845   .0483312    29.97   0.000     1.353495    1.543406
----------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress PVS Age BIPOC FemaleGender Graduate Income AgeFemGenInteraction [pweight= rakedweight], robust
(sum of wgt is 1)

Linear regression                               Number of obs     =        637
                                                F(6, 630)         =       4.23
                                                Prob > F          =     0.0003
                                                R-squared         =     0.0977
                                                Root MSE          =     .12674

--------------------------------------------------------------------------------------
                     |               Robust
                 PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------------+----------------------------------------------------------------
                 Age |    .000173   .0344986     0.01   0.996    -.0675732    .0679193
               BIPOC |   .0216196   .0196644     1.10   0.272    -.0169961    .0602354
        FemaleGender |   .0950116   .0546683     1.74   0.083    -.0123425    .2023657
            Graduate |   .0030203   .0213045     0.14   0.887    -.0388161    .0448567
              Income |  -.0170201    .009499    -1.79   0.074    -.0356737    .0016334
AgeFemGenInteraction |  -.0008545   .0014192    -0.60   0.547    -.0036415    .0019325
               _cons |   1.443189   .0376923    38.29   0.000     1.369171    1.517207
--------------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress PVS Age BIPOC FemaleGender Graduate Income Childless [pweight= rakedweight], robust
(sum of wgt is .9994273199173918)

Linear regression                               Number of obs     =        636
                                                F(6, 629)         =       2.81
                                                Prob > F          =     0.0104
                                                R-squared         =     0.1035
                                                Root MSE          =     .12634

------------------------------------------------------------------------------
             |               Robust
         PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0108593   .0122403    -0.89   0.375    -.0348961    .0131775
       BIPOC |   .0207433   .0198591     1.04   0.297    -.0182548    .0597413
FemaleGender |   .0593168   .0226194     2.62   0.009     .0148981    .1037356
    Graduate |   .0004738    .021429     0.02   0.982    -.0416073    .0425548
      Income |  -.0141286    .008709    -1.62   0.105    -.0312308    .0029735
   Childless |   .0296927   .0297282     1.00   0.318    -.0286859    .0880713
       _cons |   1.431271   .0470547    30.42   0.000     1.338868    1.523675
------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress PVS Age BIPOC FemaleGender Graduate Income Childless FemGenChildlessInteraction [pweight= rakedweight
> ], robust
(sum of wgt is .9994273199173918)

Linear regression                               Number of obs     =        636
                                                F(7, 628)         =       3.43
                                                Prob > F          =     0.0013
                                                R-squared         =     0.1054
                                                Root MSE          =     .12631

--------------------------------------------------------------------------------------------
                           |               Robust
                       PVS | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------------------+----------------------------------------------------------------
                       Age |  -.0099094   .0117499    -0.84   0.399    -.0329832    .0131644
                     BIPOC |   .0210799   .0197128     1.07   0.285     -.017631    .0597908
              FemaleGender |   .0485194   .0350163     1.39   0.166    -.0202438    .1172827
                  Graduate |   .0016717   .0218826     0.08   0.939    -.0413002    .0446437
                    Income |  -.0148112   .0089388    -1.66   0.098    -.0323648    .0027425
                 Childless |  -.0053127   .0828948    -0.06   0.949    -.1680973     .157472
FemGenChildlessInteraction |   .0235676   .0422915     0.56   0.578    -.0594822    .1066174
                     _cons |   1.447198   .0662491    21.84   0.000     1.317102    1.577295
--------------------------------------------------------------------------------------------

. eststo
(est4 stored)

. esttab 

----------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)   
                      PVS             PVS             PVS             PVS   
----------------------------------------------------------------------------
Age               -0.0200        0.000173         -0.0109        -0.00991   
                  (-1.95)          (0.01)         (-0.89)         (-0.84)   

BIPOC              0.0202          0.0216          0.0207          0.0211   
                   (0.91)          (1.10)          (1.04)          (1.07)   

FemaleGender       0.0586*         0.0950          0.0593**        0.0485   
                   (2.46)          (1.74)          (2.62)          (1.39)   

Graduate        -0.000355         0.00302        0.000474         0.00167   
                  (-0.01)          (0.14)          (0.02)          (0.08)   

Income            -0.0139         -0.0170         -0.0141         -0.0148   
                  (-1.27)         (-1.79)         (-1.62)         (-1.66)   

SocCulEmpl~t     -0.00642                                                   
                  (-0.26)                                                   

AgeFemGenI~n                    -0.000855                                   
                                  (-0.60)                                   

Childless                                          0.0297        -0.00531   
                                                   (1.00)         (-0.06)   

FemGenChil~n                                                       0.0236   
                                                                   (0.56)   

_cons               1.448***        1.443***        1.431***        1.447***
                  (29.97)         (38.29)         (30.42)         (21.84)   
----------------------------------------------------------------------------
N                     511             637             636             636   
----------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.11.log
  log type:  text
 closed on:  12 May 2025, 16:59:41
---------------------------------------------------------------------------------------------------------------
